#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>

int cnt=0;

int main()
{
  while(1)
  {
    pid_t id = fork();
  
    if(id<0)
    {
      printf("进程创建失败........%d\n",cnt);
      break;
    }
    if(id==0)
    {
      printf("i am a child .... %d\n",getpid());
      sleep(20);
      exit(0);
    }
    cnt++;
  }
  return 0;
}
